import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCluster;
import redis.clients.jedis.JedisPoolConfig;

import java.util.HashSet;
import java.util.Set;

public class JedisClusterTest {


    public static void main(String[] args) {


        JedisPoolConfig config = new JedisPoolConfig();
        Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
        jedisClusterNode.add(new HostAndPort("192.168.80.103", 7001));
        jedisClusterNode.add(new HostAndPort("192.168.80.103", 7002));
        jedisClusterNode.add(new HostAndPort("192.168.80.103", 7003));
        jedisClusterNode.add(new HostAndPort("192.168.80.103", 7004));
        jedisClusterNode.add(new HostAndPort("192.168.80.103", 7005));
        jedisClusterNode.add(new HostAndPort("192.168.80.103", 7006));
        JedisCluster jcd = new JedisCluster(jedisClusterNode, config);

        jcd.set("name100545", "zhangfei");

        String value = jcd.get("name100545");
        System.out.println(value);


    }


}
